import { Global, Module } from '@nestjs/common';
import { UploadService } from './upload.service';
import { UploadController } from './upload.controller';
import { UploaderModule } from '@app/uploader';
import { ConfigureService } from '@app/configure';

@Global()
@Module({
  imports: [
      UploaderModule.forRootAsync({
        inject : [ConfigureService],
        useFactory : async (config:ConfigureService) => {
          return {
            ...config.get('upload')
          }
        },
      }),
    ],
  providers: [UploadService],
  controllers: [UploadController],
  exports: [UploadService]
})
export class UploadModule {}
